<template>
	<view>
		<!--抽奖红包-->
		<view class="headbg">
			<view class="redbag-title">
				<view class="title-item">红包新玩法</view>
				<view>发起红包抽奖·邀请好友参与·中奖直接提现</view>
			</view>
			<view class="guides" @click="gotoguide">
				<view class="point"></view>
				<view class="guitext">
					<text>操作</text>
					<text>指南</text>
				</view>
				<text style="transform: rotate(90deg);">›</text>
			</view>
			<view class="guideline"></view>
		</view>
		
		<view class="bodypage">
			<!--输入红包抽奖金额-->
			<view class="drawbags">
				<view v-for="(item,index) in lettytables.prizeimgarr" :key="index">
					<view class="drawbags-item">
						<view class="drawbags-left">
							<view class="delete" v-if="index>0" @click="deleteprizenow(index)">-</view>
							<view class="pin">{{item.red_envelope_type=='count'?'拼':'普'}}</view>
							<view>{{item.red_envelope_type=='count'?'总金额':'单个金额'}}</view>
							<view class="changepin" @click="modifybagtype(index)">改为{{item.red_envelope_type=='count'?'普通':'拼手气'}}红包</view>
						</view>
						<view class="drawbags-right">
							<input style="font-size: 28rpx;margin-right: 10rpx;text-align: right;" @blur="moneyblurs($event,index)"
							 maxlength="3" type="number" placeholder="请输入金额" :value="item.red_envelope_money" :disabled="lettytables.pattern==2" />
							<text>元</text>
						</view>
					</view>
					<view class="drawbags-item">
						<view class="drawbags-left">
							<view>红包个数</view>
						</view>
						<view class="drawbags-right">
							<input style="font-size: 28rpx;margin-right: 10rpx;text-align: right;" :value="item.count" @blur="numbblurs($event,index)"
							 maxlength="3" type="number" placeholder="数量" :disabled="lettytables.pattern==2" />
							<text>个</text>
						</view>
					</view>
				</view>
				<view class="addbags" @click="addprizenow">+添加红包</view>
			</view>

			<!--抽奖说明-->
			<view class="lauchprize">
				<view class="prizesetinfo">
					<view>抽奖说明</view>
					<view>选填</view>
				</view>
				<view class="lauchtext">
					<view :style="{height:height}" @click="gototext">
						<textarea :value="lettytables.luckconfig.explaininfo.explanation" class="areainfos" auto-height name="explain"
						 maxlength="-1" disabled placeholder="请输入本次抽奖活动说明"></textarea>
					</view>

					<view class="lauchpeople">
						<view class="textpeople">
							<text style="color: #000;">发起人信息</text>
							<navigator url="/pages/article/index?key=hsknjzDD" class="asksymbol">?</navigator>
						</view>
						<navigator url="/pages/release/promoter" class="textpeople">
							<text>{{lettytables.luckconfig.explaininfo.contactinfo.attention_text?lettytables.luckconfig.explaininfo.contactinfo.attention_text:'微信或公众号'}}</text>
							<text style="margin-left: 10rpx;"> ›</text>
						</navigator>
					</view>
				</view>
			</view>
			
			<!--添加视频源-->
			<view class="videosource" >
				<view class="title">视频地址<text class="asksymbol" @click="drawtipeject('添加视频源','请前往短视频平台，点击复制你想要展示的短视频链接，将粘贴在下方')">?</text></view>
				<view class="videolink" @click="addvideo">
					<view class="linkbox">
						<image src="/static/image/videolink.png" mode="aspectFill"></image>
						<view v-if="lettytables.luckconfig.videourl" class="reallink">{{lettytables.luckconfig.videourl}}</view>
						<view v-else>请添加视频链接</view>
					</view>
				</view>
			</view>

			<!--开奖时间方式-->
			<view class="lauchprize" v-if="showopenmodel===0">
				<view class="prizesetinfo">
					<view class="openprize">定时开奖<text class="asksymbol" @click="drawtipeject('定时开奖','达到指定时间系统自动开奖。')">?</text></view>
					<view class="options">
						<picker @change="DrawChange" :range="opentypearray" :disabled="lettytables.pattern==2&&lettytables.partInCount>0?true:false">
							<view class="uni-input">修改开奖方式 ›</view>
						</picker>
					</view>
				</view>
				<view class="lauchtext">
					<view class="opentext">
						<text>开奖时间</text>
						<view class="huise" @tap="show">
							<input :value="lettytables.luckconfig.drawopen.start_time" type="text" style="text-align: right;font-size: 30rpx;"
							 disabled placeholder="请选择开奖时间 ›" />
						</view>
					</view>
				</view>
			</view>

			<!--开奖时间方式-->
			<view v-else-if="showopenmodel===1" class="lauchprize">
				<view class="prizesetinfo">
					<view class="openprize">满人开奖<text class="asksymbol" @click="drawtipeject('满人开奖','达到指定人数开奖，5天内未达到指定人数，系统将自动开奖。')">?</text></view>
					<view class="options">
						<picker @change="DrawChange" :range="opentypearray" :disabled="lettytables.pattern==2&&lettytables.partInCount>0?true:false">
							<view class="uni-input">修改开奖方式 ›</view>
						</picker>
					</view>
				</view>
				<view class="lauchtext">
					<view class="opentext">
						<text>开奖人数</text>
						<view class="peoplesnum">
							<input adjust-position :disabled="lettytables.pattern==2&&lettytables.partInCount>0?true:false" @blur="peoplenum"
							 :value="lettytables.luckconfig.drawopen.total_people?lettytables.luckconfig.drawopen.total_people:''" class="numinput"
							 maxlength="5" type="number" placeholder="人数" />
							<text>人</text>
						</view>
					</view>

				</view>
			</view>

			<!--手动开奖方式-->
			<view v-else-if="showopenmodel===2" class="lauchprize">
				<view class="prizesetinfo">
					<view class="openprize">手动开奖<text class="asksymbol" @click="drawtipeject('手动开奖','由发起人手动开奖，5天内未手动开奖，系统将自动开奖。')">?</text></view>
					<view class="options">
						<picker @change="DrawChange" :range="opentypearray" :disabled="lettytables.pattern==2&&lettytables.partInCount>0?true:false">
							<view class="uni-input">修改开奖方式 ›</view>
						</picker>
					</view>
				</view>
				<view class="lauchtext">
					<view class="opentext">
						<text>开奖方式</text>
						<text class="huise">手动开奖</text>
					</view>
				</view>
			</view>

			<!--开启高级功能按钮-->
			<view class="senior">
				<view class="seniortext">
					<view class="senioritem">
						<text style="color: #000; font-size: 30rpx;">高级功能</text>
						<view class="free">
							<view class="sanjiao"></view>
							<text>免费</text>
						</view>
					</view>
					<text>短视频平台、公众号平台、好友助力增粉抽奖等</text>
				</view>
				<switch :disabled="lettytables.pattern==2 && lettytables.partInCount>0" @change="opensenior" color="#378aff" :checked="lettytables.luckconfig.advanced" />
			</view>

			<!--高级功能显示区域-->
			<view v-if="lettytables.luckconfig.advanced">
				<!--图文介绍-->
				<view class="lauchprize">
					<view class="prizesetinfo">
						<view>图文介绍</view>
						<view>选填</view>
					</view>
					<navigator url="/pages/release/imageupload" v-if="lettytables.luckconfig.senior.details.detailtext" class="lauchtext">
						<view class="tuwen">
							<text>{{lettytables.luckconfig.senior.details.detailtext}}</text>
							<view class="imagstore">
								<image :key="index" v-for="(item,index) in lettytables.luckconfig.senior.details.detailimag" :src="item" mode="aspectFill"></image>
							</view>
						</view>
					</navigator>
					<navigator url="/pages/release/imageupload" class="lauchtext" v-else>
						<view class="imagetext">
							<view class="line"></view>
							<view class="line"></view>
							<view class="imgarea">
								<view class="imgarea-item"></view>
								<view class="imgarea-item"></view>
								<view class="imgarea-item"></view>
							</view>
							<view class="imagintro">
								+ 添加图文介绍
							</view>
						</view>
					</navigator>
				</view>
				<!--参与方式和分享-->
				<view class="lauchprize">
					<view class="lauchtext">
						<!-- <view :class="['opentext masklayer']">
							<view class="opentext-item">
								<text>允许参与者分享</text>
								<navigator url="/pages/article/index?key=hjsssaaSD" class="asksymbol">?</navigator>
							</view>
							<switch color="#378aff" :disabled="true" :checked="lettytables.luckconfig.senior.share" @change="isshare" />
						</view> -->
						<view :class="['opentext',lettytables.pattern==2?'masklayer':'']">
							<view class="opentext-item">
								<text>好友助力</text>
								<navigator url="/pages/article/index?key=sjkjhqAA" class="asksymbol">?</navigator>
								<text class="newtext">HOT</text>
							</view>
							<switch :disabled="lettytables.pattern==2" :checked="lettytables.luckconfig.senior.boost" color="#378aff"
							 @change="isboost" />
						</view>

						<view class="item-info" v-if="lettytables.luckconfig.senior.boost">
							<view class="content-info">
								<view class="content-title">助力倍数<text class="asksymbols" @click="drawtipeject('助力倍数','参与者每成功邀请1位好友，中奖率固定增加1倍或随机增加1~10倍。')">?</text></view>
								<view>
									<picker :disabled="lettytables.pattern==2" @change="multipleChange" :value="multipleindex" :range="multiple">
										{{multiple[multipleindex]}} ›
									</picker>
								</view>
							</view>
							<view class="content-info">
								<view class="content-title">助力红包<text class="asksymbols" @click="drawtipeject('红包激励','开启后，通过红包的形式激励用户转发分享，助力人数达到设定的值后即可获得红包奖励。')">?</text></view>
								<view v-if="lettytables.luckconfig.senior.boostconfig.help_red_envelope" @click="gotohelpered">
									{{lettytables.luckconfig.senior.boostconfig.help_red_envelope_config.help_red_type=='ordinary'?'随机红包金额':'普通红包'}}{{lettytables.luckconfig.senior.boostconfig.help_red_envelope_config.help_red_type=='ordinary'?lettytables.luckconfig.senior.boostconfig.help_red_envelope_config.help_red_amount:lettytables.luckconfig.senior.boostconfig.help_red_envelope_config.help_red_amount*lettytables.luckconfig.senior.boostconfig.help_red_envelope_config.help_red_count}}元
								</view>
								<view v-else @click="gotohelpered">去设置 ›</view>
							</view>
							<view class="content-info">
								<view class="content-title">助力口令<text class="asksymbols" @click="drawtipeject('助力口令','设置后，参与者输入口令，中奖率随机增加1~10倍')">?</text></view>
								<navigator :url="lettytables.pattern==1?'/pages/release/helpingpass':''">{{lettytables.luckconfig.senior.boostconfig.boost_password?lettytables.luckconfig.senior.boostconfig.boost_password:'去设置'}}
									›</navigator>
							</view>
						</view>
					</view>
				</view>


				<!--增粉设置-->
				<view class="lauchprize">
					<view class="lauchtext">
						<!--短视频增粉-->
						<view :class="['opentext',lettytables.luckconfig.senior.joincondition || lettytables.luckconfig.senior.joinfans || (lettytables.pattern==2&&lettytables.partInCount>0)?'masklayer':'']">
							<view class="opentext-item">
								<text>短视频增粉</text>
								<text class="asksymbols" @click="drawtipeject('短视频粉丝参与','设置短视频账号后，用户需要关注该账号并输入指定短视频号后才能参与抽奖')">?</text>
								<text class="newtext">NEW</text>
							</view>
							<switch @change="joincond($event,'video')" :checked="lettytables.luckconfig.senior.shortvideo_cond" :disabled="lettytables.luckconfig.senior.joinfans || lettytables.luckconfig.senior.joincondition || (lettytables.pattern==2&&lettytables.partInCount>0)"
							 color="#378aff" />
						</view>
						<view class="item-info" v-if="lettytables.luckconfig.senior.shortvideo_cond">
							<view class="content-info">
								<view class="content-title">短视频号</view>
								<view class="short-icon">
									<image v-if="lettytables.luckconfig.senior.joinconfig.short_video_platform>0" :src="lettytables.luckconfig.senior.joinconfig.short_video_platform==1?'/static/image/douyi_logo.png':'/static/image/kwai_logo.png'" mode="aspectFill" ></image>
									<navigator :url="lettytables.pattern==2&&lettytables.partInCount>0?'':'/pages/setinfo/accoutmanager'">{{lettytables.luckconfig.senior.joinconfig.short_video_account?lettytables.luckconfig.senior.joinconfig.short_video_account:'无' }}
										›</navigator>
								</view> 
							</view>
						</view>
						
						<!--公众号粉丝参与-->
						<view :class="['opentext',lettytables.luckconfig.senior.joincondition || lettytables.luckconfig.senior.shortvideo_cond || (lettytables.pattern==2 &&lettytables.partInCount>0)?'masklayer':'']">
							<view class="opentext-item">
								<text>公众号增粉</text>
								<text class="asksymbol" @click="drawtipeject('仅公众号粉色参与','开启后，参与者只能关注你的公众号，回复关键词才能扫码参与抽奖')">?</text>
								<!-- <text class="newtext">NEW</text> -->
							</view>
							<switch @change="joincond($event,'fans')" :checked="lettytables.luckconfig.senior.joinfans" color="#378aff" :disabled="lettytables.luckconfig.senior.joincondition  ||  lettytables.luckconfig.senior.shortvideo_cond || ( lettytables.pattern==2 &&lettytables.partInCount>0)" />
						</view>
						<view class="item-info" v-if="lettytables.luckconfig.senior.joinfans">
							<navigator :url="lettytables.pattern==2&&lettytables.partInCount>0?'':'/pages/authorization/authorization'"
							 class="content-info">
								<view class="content-title">请授权公众号</view>
								<view>{{lettytables.luckconfig.senior.joinconfig.wx_mp_name?lettytables.luckconfig.senior.joinconfig.wx_mp_name:'未授权'}}
									›</view>
							</navigator>
							<navigator :url="lettytables.pattern==2&&lettytables.partInCount>0?'':'/pages/release/replayaccount'" class="content-info">
								<view class="content-title">设置回复关键词<text class="asksymbols" @click="drawtipeject('回复关键字','设置后，在参与抽奖时，将会提示用户去你的公众号回复关键词才能参与抽奖。')">?</text></view>
								<view>{{lettytables.luckconfig.senior.joinconfig.wx_mp_key?lettytables.luckconfig.senior.joinconfig.wx_mp_key:'去设置'}}
									›</view>
							</navigator>
							<navigator url="/pages/article/index?key=GZHFSCJBZ" class="content-info" style="color: #378aff;justify-content: center;background: none;">
								如何使用公众号粉丝抽奖？
							</navigator>
						</view>
						
						<!--参与条件设置-->
						<view :class="['opentext',lettytables.luckconfig.senior.joinfans || lettytables.luckconfig.senior.shortvideo_cond || (lettytables.pattern==2&&lettytables.partInCount>0)?'masklayer':'']">
							<view class="opentext-item">
								<text>参与条件设置</text>
							</view>
							<switch @change="joincond($event,'condition')" :checked="lettytables.luckconfig.senior.joincondition" :disabled="lettytables.luckconfig.senior.joinfans || lettytables.luckconfig.senior.shortvideo_cond || (lettytables.pattern==2&&lettytables.partInCount>0)"
							 color="#378aff" />
						</view>
						<view class="item-info" v-if="lettytables.luckconfig.senior.joincondition">
							<view class='content-info'>
								<view class="content-title">抽奖口令<text class="asksymbols" @click="drawtipeject('口令抽奖','输入口令才能参与抽奖，可使用公众号或加好友的方式获取口令。')">?</text></view>
								<navigator :url="lettytables.pattern==2&&lettytables.partInCount>0?'':'/pages/release/luckpass'">{{lettytables.luckconfig.senior.joinconfig.limited_password?lettytables.luckconfig.senior.joinconfig.limited_password:'无' }}
									›</navigator>
							</view>
						</view>
					</view>
				</view>
				

				<!--开放评论-->
				<view class="lauchprize">
					<view class="lauchtext">
						<view :class="['opentext',lettytables.luckconfig.senior.comment.commentlayer?'masklayer':'']">
							<view class="opentext-item">
								<text>开放评论</text>
								<navigator url="/pages/article/index?key=hssssSS" class="asksymbol">?</navigator>
							</view>
							<switch :checked="lettytables.luckconfig.senior.comment.comment" color="#378aff" @change="commentenvet"
							 :disabled="lettytables.luckconfig.senior.comment.commentlayer" />
						</view>
						<!--开发评论审核-->
					<!-- 	<view class="opentext" v-if="lettytables.luckconfig.senior.comment.comment">
							<view class="opentext-item">
								<text>开放评论审核</text>
								<text class="asksymbol" @click="drawtipeject('提示','开启后评论需要发起人审核后再公开展示，审核通过前仅自己可见')">?</text>
							</view>
							<switch color="#378aff" @change="commenttoexamine" :checked="lettytables.luckconfig.senior.comment.comment_audit" />
						</view> -->

					</view>
				</view>
				<!--奖品发货方式-->
			</view>
			<!--建议插件-->
			<complaint></complaint>
			<view style="height: 120rpx;"></view>
		</view>
		<!--预览模式下的按钮-->
		<view class="bottomitem" v-if="lettytables.pattern==1">
			<view class="buttons emtybutton" @click="ttylpreviews">预览</view>
			<view class="buttons" @click="saveprize">发起抽奖{{lettytables.paytotal>0?'(¥'+lettytables.paytotal+')':''}}</view>
		</view>
		<!--开发模式下修改数据-->
		<view class="bottomitem" v-else>
			<view class="save-button" @click="editprize">保存修改</view>
		</view>

		<!--时间选择器-->
		<e-picker-plus ref="picker" @confirm="confirm" mode="YMDhm" />
	
		<!--发起抽奖提示-->
		<alert :modeltitle="modeltitle" :visible="visible">
			<view class="tipcontents">
				<text>你选择了{{opentypearray[showopenmodel]}}，5天内未达到指定人数，系统将自动开奖</text>
				<view class="openbutton" @click="saveprize">确认发起</view>
			</view>
		</alert>
		<!--未发布提示-->
		<alert :modeltitle="modeltitle" :visible="continueshow" :isclosebutton="false">
			<view class="continuetip">
				<text>你有上次未发布的草稿，是否继续编辑？</text>
				<view class="editbutton">
					<view class="again" @click="resetdata">重新编辑</view>
					<view class="continue" @click="editdata">继续编辑</view>
				</view>
			</view>
		</alert>
		<!--常见问题弹窗-->
		<alert :modeltitle="problemtitle" :visible="commonproblemshow">
			<view class="tipcontents">
				<text>{{commonproblem}}</text>
				<view class="openbutton" @click="closeproblem">我知道了</view>
			</view>
		</alert>

	</view>
</template>

<script>
	/**
	 * 发起抽奖
	 */
	export default {
		data() {
			return {
				dreawid: '', //是否有抽奖ID,有抽奖ID代表已发布的奖品信息
				commonproblemshow: false,
				problemtitle: '', //常见问题弹窗标题
				commonproblem: '', //常见问题弹窗内容
				continueshow: false, //继续编辑提示显示
				modeltitle: '提示',
				alerttext: '', //弹出文本提示内容
				visible: false, //显示隐藏发布提示
				realnameindex: 0,
				realname: ['不实名', '实名'],
				// sexindex: 0,
				sex: ['不限', '男生', '女生'],
				multipleindex: 0, //几倍索引
				multiple: ['固定1倍', '随机1-10倍'], //助力倍数
				opentypearray: ['定时开奖', '满人开奖', '手动开奖'], //开奖选择器数组
				//opentypeindex: 0, //开奖选择器数组
				showopenmodel: 0, //显示开奖方式模块

				height: `180rpx`,
				seniorshow: true, //高级功能显示区域
				proimg: '../../static/image/pro.png', //图片地址
				prizetitle: ['一', '二', '三', '四', '五'],

				//数据表
				lettytables: this.$luckinit,
				currrentindex: 0,
				luckyid: '', //创建活动ID
			}
		},
		onLoad(option) {
			//全局订阅事件（多次)
			uni.$on("closewindown", (param) => {
				//关闭alret提示框
				this.visible = param;
				this.continueshow = param;
				this.commonproblemshow = param;
			});
			// uni.removeStorageSync('lettytables');  
			// uni.removeStorageSync('tmpcontactus'); 
			//发起抽奖有指定ID，说明为已发布状态的数据
			if (option.id) {
				this.luckyid = option.id;
				//获取数据抽奖详情
				this.getdetaildreaw(option.id);
			} else {
				let lettytable = uni.getStorageSync('lettytables');
				//当lettytable内存有数据，并且预览模式下非红包抽奖，进行初始化处理
				if (!lettytable || lettytable.type != 'red_envelope') {
					//初始化数据
					this.lettytables = this.$luckinit;
					this.lettytables.type = 'red_envelope';
					uni.setStorageSync('lettytables', this.lettytables);
				} else {
					//继续编辑无须提示再次编辑
					if (option.continueedit && option.continueedit == "closewicket") {
						//来源为复制奖品信息，修改编辑模式为预览模式
						if(option.pattern==1){
							lettytable.pattern =1;
							uni.setStorageSync('lettytables',lettytable)
						}
						return;
					}
					//检测是否要继续编辑数据
					this.continuedata()
				}
			}
		},
		
		watch: {
			multipleindex(value) {
				this.lettytables.luckconfig.senior.boostconfig.boost_multiple = value ? 10 : 1;
			}
		},
		
		onShow() {
			//获取内存数据替换
			this.lettytables = uni.getStorageSync('lettytables');
			console.log(this.lettytables);
			//设置助力倍数
			if (this.lettytables.luckconfig.senior.boostconfig.boost_multiple > 1) {
				this.multipleindex = 1
			} else {
				this.multipleindex = 0
			}
			//解析开奖方式
			this.openDrawing()
			//抽奖说明不为空时高度发生改变
			this.explanation_auto()
			//计算价格
			this.calculateprize()
		},
		//
		mounted() {
			console.log('mounted')
			setTimeout(()=>{
				this.explanation_auto()
			},800)
		},
		//监听页面卸载
		onUnload() {
			this.setunloadStore();
		},
		//监听页面隐藏
		onHide() {
			//console.log('Onhide');
			this.sethideStore();
		},
		methods: {
			//添加视频源
			addvideo(){
				uni.navigateTo({
					url:'/pages/release/videosource'
				})
			},
			//解析开奖方式
			openDrawing(){
				switch (this.lettytables.luckconfig.drawopen.draw_type) {
					case "manual":
						this.showopenmodel = 2
						break;
					case "manchu":
						this.showopenmodel = 1
						break;
					default:
						this.showopenmodel = 0
						break;
				}
			},
			
			//自动修改抽奖说明的高度
			explanation_auto() {
				//抽奖说明不为空时高度发生改变
				if (this.lettytables.luckconfig.explaininfo.explanation) {
					this.height = `auto`
				} else {
					this.height = `180rpx`
				}
			},
			
			
			//预览抽奖
			ttylpreviews() {
				uni.navigateTo({
					url: '/pages/bagdraw/drawpage?viewtype=preview',
				})
			},

			//获取已发布的抽奖详情
			getdetaildreaw(id) {
				this.$HttRequest({
					url: '/lottery/details',
					param: {
						id: id
					},
				}).then((res) => {
					if (res.status === 10000) {
						let lotteydata = res.data;
						lotteydata.pattern = 2; //已发布模式
						this.lettytables = lotteydata;
						//解析开奖方式
						this.openDrawing()
					} else {
						this.$ShowMsg(res.message)
					}
				}).catch((error) => {
					//异常错误
					this.$ShowMsg('statusCode：' + error);
					console.log(error);

				});
			},
			//页面卸载时触发存储
			setunloadStore() {
				console.log('unload');
				console.log(this.lettytables);
				//预览模式下存储数据
				if (this.lettytables.pattern == 1) {
					//判断用户商品和抽奖说明存在则加入内存中
					if (this.lettytables.luckconfig.explaininfo.explanation || this.lettytables.prizeimgarr[0].title) {
						uni.setStorageSync('lettytables', this.lettytables);
					} else {
						//重置内存数据
						uni.setStorageSync('lettytables', this.$luckinit);
					}
				}
				//已发布模式直接不保存数据
				if (this.lettytables.pattern == 2) {
					uni.setStorageSync('lettytables', this.$luckinit);
				}

			},
			//页面隐藏时触发存储
			sethideStore() {
				console.log('hide');
				//预览模式下存储数据
				uni.setStorageSync('lettytables', this.lettytables);
			},

			//去编辑助力红包
			gotohelpered() {
				if (this.lettytables.pattern == 2) {
					this.$ShowMsg('已发布模式下不可编辑');
					return;
				}
				let tempgoos_id = '';
				this.lettytables.prizeimgarr.map((item, index) => {
					if (item.goods_id) {
						tempgoos_id += 1;
					}
				})
				// 查看是否有商品奖品
				if (tempgoos_id.indexOf(1) != -1) {
					this.$ShowMsg('红包激励和商城奖品只可二选一');
					return;
				}
				uni.navigateTo({
					url: "/pages/release/helpredbag",
				})
			},

			//常见问题弹窗口
			drawtipeject(title, msg) {
				this.problemtitle = title;
				this.commonproblem = msg;
				this.commonproblemshow = true;
			},

			//关闭常见问题弹窗
			closeproblem() {
				this.commonproblemshow = false;
			},

			//检测是否要继续编辑数据
			continuedata() {
				let lottey = uni.getStorageSync('lettytables');
				let flag = ''
				lottey.prizeimgarr.map((item, index) => {
					if (item.title) {
						flag += 1;
					}
				})
				//检测奖品和说明
				if (flag.indexOf(1) != -1 || lottey.luckconfig.explaininfo.explanation) {
					let _this = this;
					setTimeout(() => {
						_this.continueshow = true;
					}, 1000)
				}
			},
			//重置数据
			resetdata() {
				this.lettytables = this.$luckinit;
				try {
					uni.setStorageSync('lettytables', this.lettytables);
				} catch (e) {
					console.log(e);
				}
				this.continueshow = false;
			},
			//继续编辑数据
			editdata() {
				this.continueshow = false;
			},
			//移除奖品商品中获取的奖品
			deleteprizes(index) {
				this.lettytables.prizeimgarr.splice(index, 1);
				if (this.lettytables.prizeimgarr.length < 1) {
					this.addprizenow();
				}
				this.calculateprize();
			},
			
			//控制参与条件开关
			joincond(e,type) {
				if(type == 'video'){
					//短视频
					if(e.detail.value){
						this.lettytables.luckconfig.senior.joincondition = false
						this.lettytables.luckconfig.senior.joinfans = false
						this.lettytables.luckconfig.senior.shortvideo_cond = true
					}else{
						this.lettytables.luckconfig.senior.shortvideo_cond = false
					}
				}else if(type=='fans'){
					//公众号粉丝
					if(e.detail.value){
						this.lettytables.luckconfig.senior.joincondition = false
						this.lettytables.luckconfig.senior.joinfans = true
						this.lettytables.luckconfig.senior.shortvideo_cond = false
					}else{
						this.lettytables.luckconfig.senior.joinfans = false
					}
				}else if(type == 'condition'){
					//参与条件
					if(e.detail.value){
						this.lettytables.luckconfig.senior.joincondition = true
						this.lettytables.luckconfig.senior.joinfans = false
						this.lettytables.luckconfig.senior.shortvideo_cond = false
					}else{
						this.lettytables.luckconfig.senior.joincondition = false
					}
				}
				//console.log(this.lettytables.luckconfig.senior)
			},

			//添加
			addprizenow() {
				//已发布模式修改红包
				if(this.lettytables.pattern==2){
					return;
				}
				//新增数据
				if (this.lettytables.prizeimgarr.length >= 5) {
					this.$ShowMsg('最多可添加5个奖品');
					return;
				}
				this.lettytables.prizeimgarr = this.lettytables.prizeimgarr.concat({
					red_envelope_type: 'count', //'红包类型:count:总金额,sign单个红包
					red_envelope_money: '', //红包金额
					grant: 'address', //'address','contact_me 发放方式'
					title: '', //奖品标题
					count: 1, //奖品数量
					thumb: '/static/image/topdefault.png',
					//发起人信息
					contactinfo: {
						id: '', //发起人ID
						attention_text: '', //需要复制的内容
					},
					goods_id: '', //商城商品id,
					goods_price: 0, //商品的金额
					coupon_id: '', //卡券ID
				});

			},
			//删除奖品数组
			deleteprizenow(index) {
				//删除数组
				this.lettytables.prizeimgarr.splice(index, 1);
				this.calculateprize();
			},

			//失去焦点获取奖品标题数据
			titlebblurs(e, index) {
				this.lettytables.prizeimgarr[index].title = e.detail.value;
				console.log(this.lettytables);
			},
			//输入份数时间
			numinputs(e, index) {
				if (e.detail.value == 0 || e.detail.value == ' ') {
					console.log(e.detail.value)
					this.lettytables.prizeimgarr[index].count = 1;
				}
			},
			
			//红包格式修改
			modifybagtype(index) {
				if (this.lettytables.prizeimgarr[index].red_envelope_type == 'count') {
					this.lettytables.prizeimgarr[index].red_envelope_type = 'sign';
				} else {
					this.lettytables.prizeimgarr[index].red_envelope_type = 'count';
				}
				this.calculateprize();
			},
			
			//失去焦点获取金额
			moneyblurs(e, index) {
				let value = parseInt(e.detail.value);
				if (!value) {
					this.$ShowMsg('数量不能为空或者小于0');
					this.lettytables.prizeimgarr[index].red_envelope_money = 1;
					return;
				}
				this.lettytables.prizeimgarr[index].red_envelope_money = value;
				//计算金额
				this.calculateprize();
			},
			
			//失去焦点获取数量
			numbblurs(e, index) {
				let value = parseInt(e.detail.value);
				if (!value) {
					this.$ShowMsg('数量不能为空或者小于0');
					this.lettytables.prizeimgarr[index].count = 1;
					return;
				}
				this.lettytables.prizeimgarr[index].count = value;
				//计算金额
				this.calculateprize();
			},
			//计算价格
			calculateprize() {
				let nowprize = 0;
				this.lettytables.prizeimgarr.map((item, index) => {
					if(item.red_envelope_type=='count'){
						nowprize += item.red_envelope_money;
					}else{
						nowprize += item.red_envelope_money * item.count;
					}
				})
				this.lettytables.paytotal = nowprize;
			},
			//是否实名认证
			realnameChange(e) {
				this.lettytables.luckconfig.senior.joinconfig.limited_real_name = e.target.value
			},

			//更改性别
			sexChange(e) {
				this.lettytables.luckconfig.senior.joinconfig.limited_sex = e.target.value
			},

			//更改助力倍数
			multipleChange(e) {
				this.multipleindex = e.target.value
			},



			//开启高级功能
			opensenior(e) {
				this.lettytables.luckconfig.advanced = e.detail.value;
			},
			//是否开启分享
			isshare(e) {
				this.lettytables.luckconfig.senior.share = e.detail.value;
			},
			//是否允许助力
			isboost(e) {
				this.lettytables.luckconfig.senior.boost = e.detail.value;
			},
			//开启评论是否
			commentenvet(e) {
				this.lettytables.luckconfig.senior.comment.comment = e.detail.value;
			},
			//评论区审核是否开启
			commenttoexamine(e) {
				this.lettytables.luckconfig.senior.comment.comment_audit = e.detail.value;
				//开启评论遮罩
				this.lettytables.luckconfig.senior.comment.commentlayer = e.detail.value;
			},
			//选择开奖方式
			typeopenprize(index) {
				this.showopenmodel = index;
				setTimeout(() => {
					this.closewiper(false);
				}, 100)
			},
			//选择开奖时间
			show() {
				//发布后有用户参与不可修改
				if (this.lettytables.pattern == 2 && this.lettytables.partInCount > 0) {
					return
				}
				this.$refs.picker.show()
			},
			//确认开奖时间
			confirm(e) {
				
				this.lettytables.luckconfig.drawopen.start_time = e.result;
			},

			//开启选择开奖方式
			DrawChange(e) {
				let drawtypes = e.target.value;
				if (drawtypes == 0) {
					//按时开奖
					this.lettytables.luckconfig.drawopen.draw_type = 'timing';
				} else if (drawtypes == 1) {
					//满人开奖
					this.lettytables.luckconfig.drawopen.draw_type = 'manchu';
				} else if (drawtypes == 2) {
					//手动开奖
					this.lettytables.luckconfig.drawopen.draw_type = 'manual';
				}
				this.showopenmodel = drawtypes;
			},
			//开奖类型获取数据
			peoplenum(e) {
				console.log(e.detail.value);
				this.lettytables.luckconfig.drawopen.total_people = e.detail.value;
			},

			//去抽奖说明页面
			gototext() {
				if(this.lettytables.pattern == 2){
					this.$ShowMsg('红包发布后不能修改！')
					return
				}
				uni.navigateTo({
					url: '/pages/release/explain',
				})
			},
			//修改发起的抽奖
			editprize() {
				// let queuestring = '';
				// this.lettytables.prizeimgarr.map((item, index) => {
				// 	if (!item.title) {
				// 		this.$ShowMsg('请输入奖品名称或数量！');
				// 		queuestring += 1;
				// 	}
				// })
				// //未出现1代表所有标题和数量已填写可通过
				// if (queuestring.indexOf(1) != -1) {
				// 	return;
				// }
			
				//判断开奖方式
				if (this.lettytables.luckconfig.drawopen.draw_type == 'timing') {
					if (this.lettytables.luckconfig.drawopen.start_time <= 0) {
						this.$ShowMsg('请选择开奖时间');
						return;
					}
				} else if (this.lettytables.luckconfig.drawopen.draw_type == 'manchu') {
					//满人开奖
					if (this.lettytables.luckconfig.drawopen.total_people <= 0) {
						this.$ShowMsg('请输入开奖人数！');
						return;
					}
				}
				//判断是否开启公众号粉丝参与
				if(this.lettytables.luckconfig.senior.joinfans){
					if(this.lettytables.luckconfig.senior.joinconfig.wx_mp_name =='' || this.lettytables.luckconfig.senior.joinconfig.wx_mp_key==''){
						this.$ShowMsg('请设置公众号粉丝参与相关信息！')
						return
					}
				}
				let _this = this;
				_this.lettytables.id = _this.luckyid;
				//奖品发布类型为红包
				_this.lettytables.type = 'red_envelope';
				console.log(_this.lettytables);
				_this.$HttRequest({
					url: '/lottery/edit',
					param: _this.lettytables,
				}, 'POST', true).then((res) => {
					console.log(res);
					if (res.status === 10000) {
						//隐藏存储数据
						_this.lettytables = _this.$luckinit;
						//this.lettytables.type = 'red_envelope'
						//移除内存数据
						uni.setStorageSync('lettytables',_this.lettytables);
						_this.$ShowMsg('红包修改成功！');
						setTimeout(() => {
							uni.reLaunch({
								url: '/pages/bagdraw/drawpage?id=' + _this.luckyid,
							})
						}, 1500)
					} else {
						_this.$ShowMsg('红包修改失败！');
						//this.$ShowMsg(res.message)
					}
				}).catch((error) => {
					//异常错误
					_this.$ShowMsg('statusCode：' + error.errMsg);
				});
			},
			//用户发起抽奖
			saveprize() {
				//判断是否有奖品数据
				let queuestring = '';
				let moneypeople = ''
				this.lettytables.prizeimgarr.map((item, index) => {
					if (!parseInt(item.red_envelope_money)) {
						console.log(index);
						queuestring += 1;
					}
					//总红包判断不能低于0.3元
					if(item.red_envelope_type=='count'){
						if(parseInt(item.red_envelope_money)<parseInt(item.count)*0.3){
							moneypeople +=1
						}
					}
					
				})
				//未出现1代表所有标题和数量已填写可通过
				if (queuestring.indexOf(1) != -1) {
					this.$ShowMsg('请输入红包金额！');
					return;
				}
				//单个开奖红包限制
				if(moneypeople.indexOf(1)!=-1){
					this.$ShowMsg('单个红包不得低于0.3元')
					return
				}
				//判断开奖方式
				if (this.lettytables.luckconfig.drawopen.draw_type == 'timing') {
					if (this.lettytables.luckconfig.drawopen.start_time <= 0) {
						this.$ShowMsg('请选择开奖时间');
						return;
					}
				} else if (this.lettytables.luckconfig.drawopen.draw_type == 'manchu') {
					//满人开奖
					if (this.lettytables.luckconfig.drawopen.total_people <= 0) {
						this.$ShowMsg('请输入开奖人数！');
						return;
					}
					//是否开启提示
					if (!this.visible) {
						this.visible = true;
						return;
					}
				} else if (this.lettytables.luckconfig.drawopen.draw_type == 'manual') {
					//手动开奖
					//是否开启提示
					if (!this.visible) {
						this.visible = true;
						return;
					}
				}
				//判断是否开启公众号粉丝参与
				if(this.lettytables.luckconfig.senior.joinfans){
					if(this.lettytables.luckconfig.senior.joinconfig.wx_mp_name =='' || this.lettytables.luckconfig.senior.joinconfig.wx_mp_key==''){
						this.$ShowMsg('请设置公众号粉丝参与相关信息！')
						return
					}
				}
				let _this = this;
				//如发布者信息不存
				if (!_this.lettytables.sponsor) {
					_this.lettytables.sponsor = uni.getStorageSync('user_info');
				}
				//修改发布奖品类型
				_this.lettytables.type = 'red_envelope';
				console.log(_this.lettytables);
				//发起抽奖
				_this.$HttRequest({
					url: '/lottery/add',
					param: _this.lettytables,
				}, 'POST', true).then((res) => {
					console.log(res)
					if (res.status === 10000) {
						_this.visible = false;
						if (res.data.pay) {
							//发起微信支付
							uni.requestPayment({
								provider: 'wxpay',
								orderInfo: res.data.pay, //微信、支付宝订单数据
								success: function(wxres) {
									console.log('success:' + JSON.stringify(wxres));
									//隐藏存储数据
									_this.lettytables = _this.$luckinit;
									//this.lettytables.type = 'red_envelope'
									//移除内存
									uni.setStorageSync('lettytables',_this.lettytables);
									_this.$ShowMsg('红包发布成功成功！');
									setTimeout(() => {
										uni.redirectTo({
											url: '/pages/bagdraw/drawpage?id=' + res.data.id,
										})
									}, 1500)
								},
								fail: function(wxerr) {
									_this.$ShowMsg('订单取消，发布失败！')
									console.log(wxerr);
									//_this.$ShowMsg(JSON.stringify(wxerr))
								}
							})
						} else {
							//隐藏存储数据
							_this.lettytables = _this.$luckinit;
							//this.lettytables.type = 'red_envelope'
							//发布后移除内存数据
							uni.setStorageSync('lettytables',_this.lettytables);
							_this.$ShowMsg('红包发布成功！');
							setTimeout(() => {
								//无须支付，直接跳转
								uni.redirectTo({
									url: '/pages/bagdraw/drawpage?id=' + res.data.id,
								})
							}, 1500)
						}
					} else {
						_this.$ShowMsg(res.message)
						console.log(res.message)
					}
				}).catch((error) => {
					//异常错误
					_this.$ShowMsg('statusCode：' + error.errMsg);
				});
			},
			
			//操作指南
			gotoguide() {
				uni.navigateTo({
					url: '/pages/article/index?key=contactUsA'
				})
			}
		}
	}
</script>
<style lang="scss">
	page {
		background-color: #f0f0f0;
	}
	
	.drawbags {
		flex: 1;
		height: auto;
		background-color: #fff;
		border-radius: 10rpx;
		font-size: 28rpx;
		position: relative;
		z-index: 99;
		.drawbags-item {
			flex: 1;
			height: 55rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1rpx solid #f7f6f6;
			padding: 20rpx 30rpx;
	
			.drawbags-left {
				display: flex;
	
				justify-content: center;
				align-items: center;
	
				.delete {
					background-color: $uni-color-primary;
					width: 30rpx;
					height: 30rpx;
					border-radius: 50%;
					color: #fff;
					font-size: 30rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					margin-right: 10rpx;
					font-weight: bold;
				}
	
				.pin {
					display: flex;
					justify-content: center;
					align-items: center;
					width: 30rpx;
					height: 30rpx;
					background-color: #dead61;
					color: #fff;
					border-radius: 8rpx;
					font-size: 18rpx;
					margin-right: 8rpx;
				}
	
				.changepin {
					font-size: 25rpx;
					color: #b39004;
					margin-left: 15rpx;
				}
			}
	
			.drawbags-right {
				display: flex;
				justify-content: center;
				align-items: center;
	
				input {
					text-align: right;
					width: 160rpx;
					margin-right: 10rpx;
				}
			}
		}
	
		.addbags {
			color: $uni-color-primary;
			height: 80rpx;
			display: flex;
			justify-content: center;
			align-items: center;
		}
	}
	
	//红包头部
	.headbg {
		height: 220rpx;
		flex: 1;
		background-color: $uni-color-primary;
		color: #fff;
		font-size: 25rpx;
		display: flex;
		justify-content: space-between;
		align-items: center;
		padding: 0 50rpx;
		position: relative;
		
		.redbag-title {
			display: flex;
			justify-content: center;
			align-items: flex-start;
			flex-direction: column;
			position: relative;
			z-index: 999;
	
			.title-item {
				font-weight: bold;
				font-size: 45rpx;
				color: #ffec99;
				margin: 20rpx 0;
				margin-bottom: 10rpx;
			}
		}
	
		.guides {
			position: relative;
			justify-content: flex-end;
			align-items: center;
			display: flex;
			flex-direction: column;
			border-radius: 50%;
			background-color: rgba(#ffec99, 1);
			color: #a17a3d;
			width: 90rpx;
			height: 90rpx;
			font-size: 18rpx;
			z-index: 99;
			.guitext{
				display: flex;
				justify-content: center;
				align-items: center;
				flex-direction: column;
				position: absolute;
				top: 18rpx;
				left: 28rpx;
				line-height: 25rpx;
			}
			.point {
				opacity: 0.8;
				background-color: #fff;
				width: 8rpx;
				height: 8rpx;
				position: absolute;
				border-radius: 50%;
				top: 5rpx;
				left: 40rpx;
	
			}
	
		}
	
		.guideline {
			position: absolute;
			top: 0;
			right: 95rpx;
			width: 2rpx;
			height: 75rpx;
			background-color: #70B5F9;
			z-index: 66;
		}
	}
	
	.headbg:after {
			z-index: 1;
			position: absolute;
			content: '';
			border-radius: 0 0 50% 50%;
			background-color: $uni-color-primary;
			width: 100%;
			height: 80px;
			bottom: -80rpx;
			left: 0rpx;
	}
	

	.save-button {
		margin: 20rpx auto;
		width: 95%;
		height: 90rpx;
		background-color: $uni-color-primary;
		display: flex;
		justify-content: center;
		align-items: center;
		border-radius: 40rpx;
		color: #fff;
		font-size: 30rpx;
		margin-bottom: 40rpx;

	}

	//是否继续编辑按钮
	.continuetip {
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		font-size: 28rpx;

		.editbutton {
			margin: 20rpx auto;
			margin-top: 40rpx;
			width: 100%;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.again {
				width: 220rpx;
				background-color: #e6e6e6;
				color: #000;
				display: flex;
				justify-content: center;
				align-items: center;
				height: 85rpx;
				border-radius: 40rpx;
			}

			.continue {
				width: 220rpx;
				background-color: $uni-color-primary;
				color: #fff;
				display: flex;
				justify-content: center;
				align-items: center;
				height: 85rpx;
				border-radius: 40rpx;
			}
		}
	}

	.tipcontents {
		font-size: 28rpx;
		display: flex;
		justify-content: center;
		flex-direction: column;

		text {
			line-height: 50rpx;
		}

		.openbutton {
			color: #fff;
			font-size: 30rpx;
			margin: 20rpx auto;
			margin-top: 30rpx;
			background-color: $uni-color-primary;
			width: 100%;
			display: flex;
			justify-content: center;
			height: 85rpx;
			border-radius: 20rpx;
			align-items: center;
		}
	}

	//按钮
	.bottomitem {
		display: flex;
		justify-content: space-around;
		z-index: 9999;
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		font-size: 30rpx;
		border-top: 1rpx solid #e6e6e6;
		background-color: #fff;

		.buttons {
			background-color: $uni-color-primary;
			color: #fff;
			height: 88rpx;

			border-radius: 40rpx;
			width: 320rpx;
			margin: 30rpx 0;
			display: flex;
			justify-content: center;
			align-items: center;
		}

		.emtybutton {
			background-color: #fff;
			border: 2rpx solid #333;
			color: #333;
		}
	}

	//开启评论遮罩
	.masklayer {
		background-color: #fff;
		flex: 1;
		height: 100rpx;
		opacity: 0.2;
		z-index: 999;
	}

	.addprizes {
		color: $uni-color-primary;
		font-size: 28rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		height: 80rpx;
		flex: 1;
		background-color: #fff;
		margin-bottom: 20rpx;
	}

	//问号
	.asksymbols {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 28rpx;
		height: 28rpx;
		border: 2rpx solid #9e9e9e;
		border-radius: 50%;
		font-size: 25rpx;
		margin-left: 10rpx;
		color: #9e9e9e;
	}

	//高级功能
	.senior {
		display: flex;
		justify-content: space-between;
		align-items: center;
		flex: 1;
		background-color: #fffaf4;
		border-radius: 10rpx;
		border: 1rpx solid #dcdbc9;
		padding: 30rpx;
		font-size: 25rpx;
		color: #878684;

		.seniortext {
			display: flex;
			justify-content: center;
			flex-direction: column;
			align-items: flex-start;
		}

		.senioritem {
			display: flex;
			justify-content: center;
			align-items: center;
			margin-bottom: 5rpx;

			.free {
				margin-left: 10rpx;
				display: flex;
				justify-content: center;
				align-items: center;

				.sanjiao {
					width: 0;
					height: 0;
					border-right: 8rpx solid $uni-color-primary;
					border-top: 8rpx solid transparent;
					border-bottom: 8rpx solid transparent;
				}

				text {
					display: flex;
					justify-content: center;
					align-items: center;
					color: #fff;
					font-size: 22rpx;
					width: 70rpx;
					height: 40rpx;
					background-color: $uni-color-primary;
				}
			}
		}
	}

	.huise {
		color: #9f9f9f;
	}

	.openprize {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.swiper-botttoms {
		width: 100%;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;

		.swiper-bottom-item {
			width: 100%;
			height: 90rpx;
			border-bottom: 1rpx solid #eaeaea;
			display: flex;
			justify-content: center;
			align-items: center;
			font-size: 28rpx;

		}
	}

	.areainfos {
		width: 92%;
		margin: 20rpx auto;
		font-size: 28rpx;
	}

	.bodypage {
		width: 95%;
		margin: 0 auto;
		overflow-x: hidden;
	}

	.lauchtext {
		width: 100%;
		font-size: 32rpx;
		background-color: #fff;
		border-radius: 10rpx;
		position: relative;

		.tuwen {
			width: 95%;
			display: flex;
			justify-content: flex-start;
			margin: 20rpx;
			flex-direction: column;
			color: #ababab;
			font-size: 30rpx;

			text {
				display: flex;
				justify-content: flex-start;
				margin: 20rpx 0;
			}

			.imagstore {
				display: flex;
				justify-content: flex-start;
				align-items: center;

				image {
					margin: 10rpx;
					height: 150rpx;
					width: 150rpx;
				}
			}
		}

		.item-info {
			width: 100%;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			color: #ababab;
			font-size: 30rpx;

			.content-info {
				width: 90%;
				margin: 10rpx auto;
				display: flex;
				height: 65rpx;
				background-color: #f9f9f9;
				padding: 20rpx;
				justify-content: space-between;
				align-items: center;

				.content-title {
					display: flex;
					justify-content: center;
					align-items: center;
					color: #000;
				}
				.short-icon{
					display: flex;
					justify-content: center;
					align-items: center;
					image{
						margin-right: 5rpx;
						width: 40rpx;
						height: 39rpx;
					}
				}
			}

		}

		.imagetext {
			position: relative;
			flex: 1;
			padding: 30rpx;

			.imagintro {
				position: absolute;
				top: 120rpx;
				left: 220rpx;
				width: 250rpx;
				height: 65rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				font-weight: bold;
				font-size: 28rpx;
				border: 1rpx solid #696969;
				border-radius: 10rpx;
				background-color: #fff;
			}

			.line {
				width: 100%;
				height: 10rpx;
				background-color: #f7f7f7;
				margin-bottom: 20rpx;
			}

			.imgarea {
				display: flex;
				justify-content: space-between;
				align-items: center;

				.imgarea-item {
					width: 200rpx;
					height: 200rpx;
					background-color: #f7f7f7;
				}
			}
		}

		.opentext {
			flex: 1;
			font-size: 30rpx;
			padding: 0 25rpx;
			height: 100rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			border-bottom: 1rpx solid #eaeaea;

			.opentext-item {
				display: flex;
				justify-content: center;
				align-items: center;

				.newtext {
					background-color: $uni-color-primary;
					display: flex;
					justify-content: center;
					align-items: center;
					border-radius: 20rpx;
					width: 75rpx;
					height: 35rpx;
					margin-left: 20rpx;
					color: #fff;
					font-size: 18rpx;
				}
				.bignewtext{
				background-color: $uni-color-primary;
				display: flex;
				justify-content: center;
				align-items: center;
				border-radius: 20rpx;
				width: 125rpx;
				height: 35rpx;
				margin-left: 20rpx;
				color: #fff;
				font-size: 22rpx;
				}
				//问号
				.asksymbol {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 28rpx;
					height: 28rpx;
					border: 2rpx solid #9e9e9e;
					border-radius: 50%;
					font-size: 25rpx;
					margin-left: 10rpx;
					color: #9e9e9e;
				}
			}

			.peoplesnum {
				display: flex;
				justify-content: center;
				align-items: center;

				.numinput {
					text-align: right;
					width: 100rpx;
					margin-right: 8rpx;
				}
			}
		}

		.lauchpeople {
			border-top: 1rpx solid #eaeaea;
			height: 80rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;
			flex: 1;
			padding: 0 30rpx;

			.textpeople {
				color: #9e9e9e;
				display: flex;
				justify-content: center;
				align-items: center;

				//问号
				.asksymbol {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 28rpx;
					height: 28rpx;
					border: 2rpx solid #9e9e9e;
					border-radius: 50%;
					font-size: 25rpx;
					margin-left: 10rpx;
					color: #9e9e9e;
				}
			}
		}
	}
	.videosource{
		display: flex;
		justify-content: flex-start;
		align-items:  flex-start;
		flex-direction: column;
		font-size: 27rpx;
		width: 100%;
		margin: 0 auto;
		.title{
				display: flex;
				justify-content: center;
				align-content: center;
				//问号
				.asksymbol {
					display: flex;
					align-items: center;
					justify-content: center;
					width: 28rpx;
					height: 28rpx;
					border: 2rpx solid #9e9e9e;
					border-radius: 50%;
					font-size: 25rpx;
					margin-left: 10rpx;
					color: #9e9e9e;
				}
		}
		.videolink{
			display: flex;
			justify-content: space-between;
			align-items: center;
			height: 80rpx;
			width: 100%;
			margin-top: 20rpx;
			background-color: #fff;
			border-radius: 10rpx;
			color: #9e9e9e;
			.linkbox{
				display: flex;
				align-items: center;
				justify-content: flex-start; 
				width: 100%;
				.reallink{
					width: 80%;
					display: flex;
					justify-content: flex-start;
					align-items: center;
					padding:8rpx 20rpx;
					background-color: #f0f0f0;
					border-radius: 10rpx;
				}
				image{
					width: 30rpx;
					height: 30rpx;
					margin-right:20rpx;
					margin-left: 30rpx;
				}
			}
		}
		
	}
	.lauchprize {
		flex: 1;
		display: flex;
		justify-content: center;
		align-items: center;
		flex-direction: column;
		margin-bottom: 20rpx;


		.prizesetinfo {
			margin: 20rpx 0;
			width: 100%;
			font-size: 27rpx;
			display: flex;
			justify-content: space-between;
			align-items: center;

			.asksymbol {
				display: flex;
				align-items: center;
				justify-content: center;
				width: 28rpx;
				height: 28rpx;
				border: 2rpx solid #9e9e9e;
				border-radius: 50%;
				font-size: 25rpx;
				margin-left: 10rpx;
				color: #9e9e9e;
			}

			.options {
				color: $uni-color-primary;
			}
		}

		.item-pirze {
			border-radius: 10rpx;
			width: 100%;
			background-color: #fff;
			display: flex;
			justify-content: center;
			align-items: center;
			flex-direction: column;
			position: relative;

			.prizemall {
				width: 140rpx;
				position: absolute;
				top: 20rpx;
				right: 220rpx;
				background: rgba(0, 0, 0, 0.3);
				font-size: 25rpx;
				color: #fff;
				display: flex;
				justify-content: space-between;
				align-items: center;
				border-radius: 40rpx;
				padding: 10rpx 20rpx;

				.iconfont {
					font-size: 35rpx;
					color: #fff;
				}
			}

			.changepic {

				width: 140rpx;
				position: absolute;
				top: 20rpx;
				right: 20rpx;
				background: rgba(0, 0, 0, 0.3);
				font-size: 25rpx;
				color: #fff;
				display: flex;
				justify-content: space-between;
				align-items: center;

				border-radius: 40rpx;
				padding: 10rpx 20rpx;

				image {
					width: 40rpx;
					height: 40rpx;
				}
			}

			.imgpro {
				margin-top: 8rpx;
				width: 700rpx;
				height: 373rpx;
				border-top-left-radius: 10rpx;
				border-top-right-radius: 10rpx;
			}

			.items {
				height: 80rpx;
				font-size: 30rpx;
				border-bottom: 1rpx solid #eaeaea;
				width: 100%;
				display: flex;
				justify-content: space-between;
				align-items: center;

				.delete {
					background-color: $uni-color-primary;
					width: 30rpx;
					height: 30rpx;
					border-radius: 50%;
					color: #fff;
					font-size: 30rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					margin-right: 10rpx;
					font-weight: bold;
				}

				.titleinput {
					text-align: right;
					margin-right: 30rpx;
				}

				.titleprize {
					display: flex;
					justify-content: center;
					align-items: center;
					margin-left: 35rpx;
				}

				.item-num {

					display: flex;
					justify-content: flex-start;
					align-items: center;
					margin-right: 35rpx;

					.numinput {
						text-align: right;
						width: 80rpx;
						margin-right: 8rpx;
					}
				}
			}


		}
	}
</style>
